package com.yanqu.road.entity.rank;


import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.union.UnionBaseInfo;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class UnionRank {

	private String unionUid;

	private UnionBaseInfo unionBaseInfo = new UnionBaseInfo();
	private Map<Integer, Integer> originalGradeAmountMap = new HashMap<>();
	private Map<Integer, Integer> nowGradeAmountMap = new HashMap<>();
	private Map<Integer, Integer> gradeLimitAmountMap = new HashMap<>();
	private int rank;

	public String getUnionUid() {
		return unionUid;
	}

	public void setUnionUid(String unionUid) {
		this.unionUid = unionUid;
	}

	public UnionBaseInfo getUnionBaseInfo() {
		return unionBaseInfo;
	}

	public String getUnionBaseInfoJsonStr(){
		if(null == unionBaseInfo){
			return "{}";
		}else {
			return JSON.toJSONString(unionBaseInfo);
		}
	}

	public void setUnionBaseInfo(UnionBaseInfo unionBaseInfo) {
		this.unionBaseInfo = unionBaseInfo;
	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public UnionRank clone(){
		UnionRank cloneRank = new UnionRank();
		cloneRank.setUnionUid(unionUid);
		cloneRank.setUnionBaseInfo(unionBaseInfo);
		cloneRank.setGradeLimitAmountMap(new ConcurrentHashMap<>(this.gradeLimitAmountMap));
		cloneRank.setNowGradeAmountMap(new ConcurrentHashMap<>(this.nowGradeAmountMap));
		cloneRank.setOriginalGradeAmountMap(new ConcurrentHashMap<>(this.originalGradeAmountMap));
		return cloneRank;
	}

	public Map<Integer, Integer> getOriginalGradeAmountMap() {
		return originalGradeAmountMap;
	}

	public void setOriginalGradeAmountMap(Map<Integer, Integer> originalGradeAmountMap) {
		this.originalGradeAmountMap = originalGradeAmountMap;
	}

	public Map<Integer, Integer> getNowGradeAmountMap() {
		return nowGradeAmountMap;
	}

	public void setNowGradeAmountMap(Map<Integer, Integer> nowGradeAmountMap) {
		this.nowGradeAmountMap = nowGradeAmountMap;
	}

	public Map<Integer, Integer> getGradeLimitAmountMap() {
		return gradeLimitAmountMap;
	}

	public void setGradeLimitAmountMap(Map<Integer, Integer> gradeLimitAmountMap) {
		this.gradeLimitAmountMap = gradeLimitAmountMap;
	}
}
